package com.happyclub.paul.service.impl;

import com.happyclub.paul.dao.AlbumPhotoMapRepostitory;
import com.happyclub.paul.service.IAlbumPhotoMapService;
import com.happyclub.pojo.TbAlbumPhotoMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.List;

/**
 * @Auther: 魏泉琦
 * @Date: 2019/4/7 11:59
 * @Description:  相册相片中间表
 */
@Service
public class AlbumPhotoMapServiceImpl implements IAlbumPhotoMapService {

    @Autowired
    private AlbumPhotoMapRepostitory albumPhotoMapRepostitory;


    /**
     *@Description: 通过相册编号查询拥有的相片
     *@Author: 魏泉琦
     *@date: 2019/4/7
     */
    @Override
    public List<TbAlbumPhotoMap> queryAlbumPhotosByaAlbumId(String albumId) {
        List<TbAlbumPhotoMap> albumPhotoMaps  = albumPhotoMapRepostitory.queryAlbumPhotosByaAlbumId(albumId);
        return albumPhotoMaps;
    }


    /**
     *@Description: 通过相册编号删除中间表数据
     *@Author: 魏泉琦
     *@date: 2019/4/9
     */
    @Transactional
    @Override
    public Integer deletePhotoAlbumMapByAlbumId(String albumId) {
        return albumPhotoMapRepostitory.deletePhotoAlbumMapByAlbumId(albumId);
    }
}
